The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(tidyr)library(stars)
Loading required package: abind
Loading required package: sf
Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.1; sf_use_s2() is TRUE
library(terra)
terra 1.7.46
Attaching package: 'terra'
The following object is masked from 'package:tidyr':
extract
Stations
Create a table with rows for each station and pollutant recorded. Stations have a type (background, industrial, traffic), an area label (rural, urban, suburban), and coordinates in lon/lat.
Joining with `by = join_by(AirQualityStationEoICode)`
Warning in sf_column %in% names(g): Detected an unexpected many-to-many relationship between `x` and `y`.
ℹ Row 1608 of `x` matches multiple rows in `y`.
ℹ Row 1608 of `y` matches multiple rows in `x`.
ℹ If a many-to-many relationship is expected, set `relationship =
"many-to-many"` to silence this warning.
pop =rast("supplementary/JRC_GRID_2018/JRC_1K_POP_2018.tif")
Warning in new_CppObject_xp(fields$.module, fields$.pointer, ...): GDAL
Message 1: The definition of projected CRS EPSG:3035 got from GeoTIFF keys is
not the same as the one from the EPSG registry, which may cause issues during
reprojection operations. Set GTIFF_SRS_SOURCE configuration option to EPSG to
use official parameters (overriding the ones from GeoTIFF keys), or to GEOKEYS
to use custom values from GeoTIFF keys and drop the EPSG code.
Joining with `by = join_by(AirQualityStationEoICode)`
Warning in left_join(station_meta, station_laea): Detected an unexpected many-to-many relationship between `x` and `y`.
ℹ Row 3767 of `x` matches multiple rows in `y`.
ℹ Row 1 of `y` matches multiple rows in `x`.
ℹ If a many-to-many relationship is expected, set `relationship =
"many-to-many"` to silence this warning.
# A tibble: 15,881 × 11
AirQualityStationEoICode Countrycode StationType StationArea AirPollutant
<fct> <fct> <fct> <fct> <fct>
1 4101422 TR industrial suburban PM10
2 4101422 TR industrial suburban NO2
3 4101522 TR industrial suburban PM10
4 4101522 TR industrial suburban NO2
5 AD0942A AD background urban PM2.5
6 AD0942A AD background urban PM10
7 AD0942A AD background urban NO2
8 AD0942A AD background urban O3
9 AD0944A AD background rural O3
10 AD0945A AD background rural O3
# ℹ 15,871 more rows
# ℹ 6 more variables: Longitude <dbl>, Latitude <dbl>, geometry <POINT [m]>,
# Elevation <dbl>, CLC8 <fct>, Population <int>
summary(station_meta)
AirQualityStationEoICode Countrycode StationType
IT1170A: 24 IT :2213 background:9952
IT2129A: 16 ES :2054 industrial:2025
TR0066A: 16 DE :1966 traffic :3904
SE0093A: 12 FR :1885
IT1090A: 9 TR :1253
E135019: 8 PL :1024
(Other):15796 (Other):5486
StationArea AirPollutant Longitude Latitude
rural :1817 PM2.5:2862 Min. :-63.081 Min. :-21.34
rural-nearcity: 253 PM10 :4725 1st Qu.: 3.363 1st Qu.: 41.72
rural-regional: 451 NO2 :5123 Median : 10.791 Median : 46.65
rural-remote : 124 O3 :3171 Mean : 10.811 Mean : 46.34
suburban :3602 3rd Qu.: 17.961 3rd Qu.: 50.92
urban :9634 Max. : 55.628 Max. : 78.91
geometry Elevation CLC8 Population
POINT :15881 Min. : -52 LDR :7478 Min. : 0
epsg:3035 : 0 1st Qu.: 328 HDR :3002 1st Qu.: 172
+proj=laea...: 0 Median : 1152 AGR :2032 Median : 2448
Mean : 2036 IND :1357 Mean : 4132
3rd Qu.: 2737 NAT : 941 3rd Qu.: 5910
Max. :30185 (Other): 883 Max. :51127
NA's :1420 NA's : 188